package com.example.module_common.http

import com.example.module_common.base.BaseModel
import com.example.module_common.constants.Constants
import com.example.module_common.model.*
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

interface ApiServer {
    //首页文章列表
    @GET(Constants.ART_LIST)
     fun articleList(@Path("page") page: Int): Observable<BaseModel<List<ArticleListModel>>>

    //首页广告
    @GET("/banner/json")
     fun banner(): Observable<BaseModel<List<BannerModel>>>

    //常用网站
    @GET("/friend/json")
    fun friend(): Observable<BaseModel<*>>

/*    //搜索热词
    @GET("/hotkey/json")
    fun hotkey(): Observable<BaseModel<List<HotKeyModel>>>*/

    //体系数据
    @GET("/tree/json")
    fun tree(): Observable<BaseModel<List<KnowledgeModel.DataBean>>>

    //知识体系下的文章
    @GET("article/list/{page}/json")
    fun article(
        @Path("page") page: Int,
        @Query("cid") cid: Int
    ): Observable<BaseModel<ArticleListModel>>

    //导航
    @GET("/navi/json")
    fun navi(): Observable<BaseModel<List<NavigationModel.DataBean>>>

    //导航分类
    @GET("/navi/json")
    fun navicontent(): Observable<BaseModel<List<NavigationModel.DataBean>>>

    //项目分类
    @GET("/project/tree/json")
    fun projectTree(): Observable<BaseModel<List<ProjectTitleModel.DataBean>>>

    //项目分类下的列表
    @GET("/project/list/{page}/json")
    fun projectList(
        @Path("page") page: Int,
        @Query("cid") cid: Int
    ): Observable<BaseModel<ProjectListModel>>
}